﻿@model dynamic

@{
    ViewBag.Title = "出区诊断";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<form id="form1">
    <div class="panel-default" style="padding-right:10px;">
        <table id="tablezd" class="form">
            <tr>
                <th class="formTitle">诊断时间：</th>
                <td class="formValue">
                    <input id="txt_zdsj" type="text" class="form-control input-wdatepicker formClearIgnore" style="width:100%;" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })"
                           onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss', onpicked: function () { RefreshOrder() } })" value="@DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")" />
                </td>
            </tr>
			<tr>
					
				<th class="formTitle" style="margin-left:20px;">
					@*<i id="zdCircle" class="fa fa-plus-circle plusToggleCircle" aria-hidden="true" style="width:30px;margin-left: 10px; color: #6ff3ad; font-size: large;"></i>*@
					医嘱诊断：
				</th>
				<td class="formValue" colspan="2">
					<input id="txt_cyzddm" type="hidden" />
					<input id="txt_cyzd" name="txt_cyzd" type="text" class="form-control required zdinput" />
				</td>
			</tr>
        </table>
    </div>
</form>
<script lang="javascript">
    var ybnhlx = "";
    $(function () {
    });
    //$(window).bind('beforeunload', function () {
    //    alert("是否要离开");
    //    if ($('#txt_zdsj').val() == null || $('#txt_zdsj').val() == "") {
    //        $.modalAlert("需要填写时间！", "warning");
    //        return;
    //    }
    //    if ($('#txt_cyzddm').val() == null || $('#txt_cyzddm').val() == "") {
    //        $.modalAlert("需要填写诊断！", "warning");
    //        return;
    //    }
    //});
    var mzzy = '@ViewBag.zyh';
    if (mzzy== "zy") {
        $("#txt_cyzd").zdFloatingSelector({
            zdlx: "TCM",
            ybnhlx: ybnhlx,
            width: 600,
            itemdbclickhandler: function ($this) {
                $("#txt_cyzd").val($this.attr('data-zdmc'));
                $("#txt_cyzddm").val($this.attr('data-zdCode'));
            }
        });
    }
    else {
        $("#txt_cyzd").zdFloatingSelector({
            zdlx: "WM",
            ybnhlx: ybnhlx,
            width: 600,
            itemdbclickhandler: function ($this) {
                $("#txt_cyzd").val($this.attr('data-zdmc'));
                $("#txt_cyzddm").val($this.attr('data-zdCode'));
            }
        });
        }
    function Orderdiagnosis() {
        var obj = new Object();
        if ($('#txt_zdsj').val() == null || $('#txt_zdsj').val() == "") {
            $.modalAlert("需要填写时间！", "warning");
            return;
        }
        if ($('#txt_cyzddm').val() == null || $('#txt_cyzddm').val() == "") {
            $.modalAlert("需要填写诊断！", "warning");
            return;
        }
        obj.zdsj = $('#txt_zdsj').val();
        obj.jbbm = $('#txt_cyzddm').val();
        obj.jbmc = $('#txt_cyzd').val();
        return obj;
    }
</script>